module.exports = class extends think.Logic {
  addAction() {
    this.allowMethods = 'post';
    this.rules = {
      type: {
        int: true,
        required: true,
        method: 'POST'
      },
      legal: {
        int: true,
        required: true,
        method: 'POST'
      },
      note: {
        string: true,
        required: true,
        method: 'POST'
      },
      startDate: {
        int: true,
        required: true,
        method: 'POST'
      },
      endDate: {
        int: true,
        required: true,
        method: 'POST'
      }
    };
  }

  editAction() {
    this.allowMethods = 'put';
    this.rules = {
      type: {
        int: true,
        required: true,
        method: 'PUT'
      },
      legal: {
        int: true,
        required: true,
        method: 'PUT'
      },
      note: {
        string: true,
        required: true,
        method: 'PUT'
      },
      startDate: {
        int: true,
        required: true,
        method: 'PUT'
      },
      endDate: {
        int: true,
        required: true,
        method: 'PUT'
      },
      id: {
        int: true,
        required: true,
        method: 'GET'
      }
    };
  }

  delAction() {
    this.allowMethods = 'delete';
    this.rules = {
      id: {
        required: true,
        method: 'GET'
      }
    };
  }

  listAction() {
    this.allowMethods = 'get';
  }
};
